Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional query store improvements / fixes #6439

Merged

Conversation

christianbaroni
Copy link
Member

What changed (plus any additional context for devs)

  • Follow-up to Store creator and createQueryStore improvements #6435
    • hasAllRequiredParams was iterating over indices instead of values — key in should have been key of
      • This was causing false negatives (params complete, but deemed not) that unnecessarily duplicated the param resolving work
  • Fixes an enabled edge case where if a store was persisted with an enabled value different from its enabled config value, the subscriptionManager could possibly start out with a different enabled value than the store. Also fixes a similar issue affecting dynamic enabled params.
    • (Neither of these issues affect the query stores currently in use as they're always enabled)
  • Removes cancel from the args passed to fetcher, as it was simply calling abort() on the abortController already provided to fetcher. And for "hard" aborts to work (to abort the network call itself, not just the work that follows it), you need to pass the abortController along to your actual fetch request, so it was a bit of a misdirection.

Screen recordings / screenshots

What to test

@brunobar79
Copy link
Member

Launch in simulator or device for 11c674c

Comment on lines +990 to +991
if (initialStoreEnabled !== oldVal) queryStore.setState(state => ({ ...state, enabled: oldVal }));
if (oldVal) subscriptionManager.setEnabled(oldVal);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

@christianbaroni christianbaroni merged commit eea414b into develop Feb 2, 2025
9 checks passed
@christianbaroni christianbaroni deleted the @christian/query-store-enabled-improvements branch February 2, 2025 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants